package org.hhchat.leetcode.greedy;

import java.util.Arrays;

/**
 * Created this one by HMH on 2017/10/2.
 */
public class code455_easy {
    static class Solution {
        public int findContentChildren(int[] g, int[] s) {
            Arrays.sort(g);
            Arrays.sort(s);
            int i = 0;
            for(int j=0;i<g.length && j<s.length;j++) {
                if(g[i]<=s[j]) i++;
            }
            return i;
        }
    }

    public static void main(String[] args){
        Solution solution = new Solution();
        System.out.println(solution.findContentChildren(new int[]{1,2,3},new int[]{3}));
    }

}
